This article transferred from: Http://www.tuicool.com/articles/zeymimBWith the increase in web traffic around the world, we are also constantly internationalizing and localizing applications as developers. When a user accesses our app, he should be
I. Syntax: TRANSLATE (string, from_str, to_str) II. Purpose return: replace each character in from_str (all appearing) with a string after the corresponding character in to_str. TRANSLATE Is a superset of the functions provided by REPLACE. If
--translate functionFunction Description:Translate (str, FROM_STR, TO_STR), replacing the from_str in str with TO_STR.Translate is a superset of the functionality provided by replace. From_str and To_str are the corresponding relationships from left
Many Web services face not only the local users, the multi-lingual environment can not only enhance the force lattice, more important is a user experience.Angular.js as a solution to the front-end split, of course, can not be separated from the
TRANSLATE is a superset of the functionality provided by REPLACE.
Syntax: TRANSLATE (STRING,FROM_STR,TO_STR) parameter
1:string, original string parameter
2:from_str, string parameter
3:to_str that needs to be replaced, used to replace
Let's take a look at the official definitions of these two functions:
String. maketrans (from, to): return a translation table suitable for passing to translate (), that will map each character in from into the character at the same position in;
Application of closures in python: usage of translate and maketrans, pythonmaketrans
Python is relatively efficient in processing strings, and there are many methods. The maketrans and translate methods are used in many cases. This article
Application of closures in python, explanation of the translate and maketrans methods, and pythonmaketrans
Python is efficient in processing strings and has many methods. The maketrans and translate methods are used in many ways, but they often
Recipe 1.9. Simplifying usage of strings 'translate Method
Recipe 1.9. Simplify the usage of the string translate method
Credit: Chris Perkins, Raymond hettinger
Problem
You often want to use the efficient string translate method, but it is
The Oracle translate function and replace function Usage Details, oracletranslate
Syntax of the translate function:
translate(expr, from_strimg, to_string)
Introduction:
Translate returns expr, where all occurrences of each character in from_string
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.